using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using BaHuan.Common;
using BaHuan.Entities;
using BaHuan.DataLayer;
/*
 * There are many processes that handle the flows of data
 * we call them business logic of a program.
 * For each of business logic process we create a class 
 * that handle for that process
 * 
 * */
namespace BaHuan.BusinessLayer
{
	
	public class BangKeNhapHangMgt
	{
	
		public ResultObj SaveNewBangKeNhapHang(BangKeNhapHang bangkenhaphang)
        		{
			ResultObj result = new ResultObj();
			bangkenhaphang.Id = -1;
			BangKeNhapHangDAO bangkenhaphangDAO = new BangKeNhapHangDAO();
			result = bangkenhaphangDAO.SaveBangKeNhapHang(bangkenhaphang);
			
			return result;
		}
		
		public ResultObj UpdateBangKeNhapHang(BangKeNhapHang bangkenhaphang)
        		{
			ResultObj result = new ResultObj();
			BangKeNhapHangDAO bangkenhaphangDAO = new BangKeNhapHangDAO();
			result = bangkenhaphangDAO.SaveBangKeNhapHang(bangkenhaphang);
			
			return result;
		}
		
		public ResultObj DeleteBangKeNhapHang(BangKeNhapHang bangkenhaphang)
        		{
			ResultObj result = new ResultObj();
			BangKeNhapHangDAO bangkenhaphangDAO = new BangKeNhapHangDAO();
			result = bangkenhaphangDAO.DeleteBangKeNhapHang(bangkenhaphang);
			
			return result;
		}
		
		public ResultObj GetAllBangKeNhapHang()
        		{
			ResultObj result = new ResultObj();
			BangKeNhapHangDAO bangkenhaphangDAO = new BangKeNhapHangDAO();
			result = bangkenhaphangDAO.GetAllBangKeNhapHang();
			
			return result;
		}

        public ResultObj GetAllBangKeNhapHangToCheckCode()
        {
            ResultObj result = new ResultObj();
            BangKeNhapHangDAO bangkenhaphangDAO = new BangKeNhapHangDAO();
            result = bangkenhaphangDAO.GetAllBangKeNhapHangToCheckCode();

            return result;
        }
		
		public ResultObj GetBangKeNhapHangById(BangKeNhapHang bangkenhaphang)
        		{
			ResultObj result = new ResultObj();
			BangKeNhapHangDAO bangkenhaphangDAO = new BangKeNhapHangDAO();
			result = bangkenhaphangDAO.GetAllBangKeNhapHangByID(bangkenhaphang);
			
			return result;
		}

        public ResultObj GetBangKeNhapHangByMaSo(BangKeNhapHang bangkenhaphang)
        {
            ResultObj result = new ResultObj();
            BangKeNhapHangDAO bangkenhaphangDAO = new BangKeNhapHangDAO();
            result = bangkenhaphangDAO.GetAllBangKeNhapHangByMaSo(bangkenhaphang);

            return result;
        }	
	}
}
